﻿<div ng-controller="inviteHorsePowerSettingController">
    <div class="wrapper border-bottom white-bg page-heading">
        <div class="col-lg-pull-12">
            <ol class="breadcrumb">
                <li>邀请好友(超过10人)马力设置</li>
            </ol>
        </div>
    </div>
    <form class="form-horizontal row">
        <div class="form-group">
            <div class="col-sm-4">
                <div class="col-sm-offset-4 col-sm-8">
                    <button class="btn btn-primary btn-sm" ng-click="search()"><i class="fa fa-search"></i>刷新</button>
                    <button class="btn btn-primary btn-sm" ui-sref="app.inviteHorsePowerSetting.detail()"><i class="fa fa-plus"></i> 添加</button>
                </div>
            </div>
        </div>
    </form>
    <table style="table-layout:fixed;" class="table table-hover m-t-md">
        <thead>
            <tr style="background-color: #f7f7f9;">
                <th>序号</th>
                <th>开始时间</th>
                <th>结束时间</th>
                <th>增加马力（邀请超过10人）</th>
                <th>状态</th>
                <th>更新时间</th>
                <th>创建时间</th>
                <th width="130">操作</th>
            </tr>
        </thead>
        <tbody ng-repeat="item in model.rows">
            <tr>
                <td>{{$index+1}}</td>
                <td>{{item.begin_time}}</td>
                <td>{{item.end_time}}</td>
                <td>{{item.horse_power}}</td>
                <td style="{{item.status == 1 ? 'color:#337ab7':item.status == 3 ? 'color:#d3d3d3':''}}">{{item.status_title}}</td>
                <td>{{item.update_time}}</td>
                <td>{{item.create_time}}</td>
                <td>
                    <a ng-if="item.status == 1" class="btn btn-primary btn-xs" href="javascript:void(0);" ng-click="updateStatus(item.id, 2)"><i class="fa fa-cog"></i> 停用</a>
                    <a ng-if="item.status == 2" class="btn btn-primary btn-xs" href="javascript:void(0);" ng-click="updateStatus(item.id, 1)"><i class="fa fa-cog"></i> 启用</a>
                    <a ng-if="item.status != 2" class="btn btn-primary btn-xs" ui-sref="app.inviteHorsePowerSetting.detail({id:{{item.id}}})"><i class="fa fa-cog"></i> 查看</a>
                    <a ng-if="item.status != 3" class="btn btn-primary btn-xs" href="javascript:void(0);" ng-click="updateStatus(item.id, 3)"><i class="fa fa-trash"></i> 删除</a>
                    <a ng-if="item.status == 2" class="btn btn-primary btn-xs" ui-sref="app.inviteHorsePowerSetting.detail({id:{{item.id}}})"><i class="fa fa-cog"></i> 修改</a>
                </td>
            </tr>
        </tbody>
    </table>
    <div class="row">
        <div class="col-md-12">
            <uib-pagination total-items="model.total_result" items-per-page="model.size" ng-model="model.page" num-pages="model.total_pages"
                            ng-change="search_page(model.page)" class="pagination-sm" boundary-links="true" boundary-link-numbers="true" max-size="20"
                            previous-text="&lsaquo;" next-text="&rsaquo;" first-text="&laquo;" last-text="&raquo;"></uib-pagination>
            <span class="pull-right" style="margin: 30px 0px 20px 0px">共{{model.total_result}} 当前：{{model.page}}/{{model.total_pages}}</span>
        </div>
    </div>
</div>
